<?php

declare(strict_types=1);

namespace app\admin\controller\coupon;

use app\admin\controller\Controller;
use app\model\CouponCate;
use think\Request;

class Cate extends Controller
{
    //分类列表
    public function cateList(){
        $params=input();
        $data=CouponCate::cateList();
        return success('', $data);
    }

    //增加编辑分类
    public function saveCate(Request $request){
        $params = $request->only(['id', 'name','status','sort']);
        $data=CouponCate::saveCate($params,"edit_cate");
        return $data;
    }

    //修改品牌状态
    public function setStatus(Request $request){
        $params = $request->only(['id', 'status']);
        $data=CouponCate::saveCate($params,"set_status");
        return $data;
    }

    //删除分类
    public function delCate(Request $request){
        $params = $request->only(['id']);
        $data=CouponCate::delCate($params);
        return $data;
    }

    //分类列表
    public function cateSelectList(){
        $params = input();
        $data = CouponCate::cateSelectList($params);
        return success('查询成功', $data);
    }


}
